# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=tree-sitter-cli
pkgver=0.20.8
pkgrel=4
pkgdesc="Tree Sitter CLI"
url="https://tree-sitter.github.io/"
arch="all"
license="MIT"
makedepends="
	cargo
	cargo-auditable
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v$pkgver.tar.gz
	lfs64.patch
	"
builddir="$srcdir/tree-sitter-$pkgver"
options="!check" # fail in this release

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked

	sh ./script/fetch-fixtures
}

build() {
	cargo auditable build -p tree-sitter-cli --frozen --release
}

check() {
	cargo test -p tree-sitter-cli --frozen
}

package() {
	install -Dm755 target/release/tree-sitter -t "$pkgdir"/usr/bin/
}

sha512sums="
30fa3f97e1a24d469a7565dc91db629accdfbe081b43d951e9751059a0c7f763d727e95efce5806cd9b1689650773bee1106f4f91ba001da57df3b0d83dda967  tree-sitter-cli-0.20.8.tar.gz
12d2d315c9136f315b7ac7e0cf10e3e29503deaa0a8ed4cba3085d33d1e48ff0b80d764343d61a3326a0aee2f57fe3732516aca578b5fff0776ae4b8ed449c01  lfs64.patch
"
